package com.ruoyi.web.petmall.petback.service.impl;

import com.ruoyi.web.petmall.entity.BreedEntity;
import com.ruoyi.web.petmall.entity.TypeEntity;
import com.ruoyi.web.petmall.petback.mapper.BreedMapper;
import com.ruoyi.web.petmall.petback.service.BreedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BreedServiceImpl implements BreedService {

    @Autowired
    private BreedMapper breedMapper;

    /**
     * 查询宠物品种列表
     *
     * @param breedEntity 查询条件封装为 BreedEntity 对象
     * @return 宠物品种列表
     */
    @Override
    public List<BreedEntity> getPetBreed(BreedEntity breedEntity) {
        return breedMapper.getPetBreed(breedEntity);
    }

    /**
     * 添加宠物品种
     *
     * @param breedEntity 要添加的宠物品种信息封装为 BreedEntity 对象
     * @return 受影响的行数
     */
    @Override
    public int addPetBreed(BreedEntity breedEntity) {
        return breedMapper.addPetBreed(breedEntity);
    }

    /**
     * 修改宠物品种
     *
     * @param breedEntity 要修改的宠物品种信息封装为 BreedEntity 对象
     * @return 受影响的行数
     */
    @Override
    public int updatePetBreed(BreedEntity breedEntity) {
        return breedMapper.updatePetBreed(breedEntity);
    }

    /**
     * 删除宠物品种
     *
     * @param breedId 要删除的宠物品种 ID
     * @return 受影响的行数
     */
    @Override
    public int deletePetBreed(Long breedId) {
        return breedMapper.deletePetBreed(breedId);
    }
}
